package main.rsevents;

import java.util.HashMap;

import main.listeners.ServerMessagesHandler;

public class EventHandler implements Runnable {
	
	public static HashMap<String, RSEvent> rsEventsList = new HashMap<String, RSEvent>();

	@Override
	public void run() {
		initEvents();
		
	}
	
	public void initEvents() {
		rsEventsList.put("ServerMessage", new ServerMessage());
	}
	
	public static void fireEvent(RSEventContainer rsec) {
		RSEvent event = rsEventsList.get(rsec.getType());
		if(event == null) {
			return;
		}
		ServerMessagesHandler.handleMessage(rsec.getMessage());
		//event.onRecievedEvent(rsec);
	}

}
